using Engine;
using Game;
using GameEntitySystem;

namespace SCIENEW {
    public class RiflingDevice : FourDirectionalDevice, ICrafterDevice<ComponentRifling>, IElectricElementDevice{
        public RiflingDevice() : base("RiflingDevice", 105, upSlot: 209, sideSlot: 103, rotate: true){}
        public string GetEntityName(int value) => "Rifling";
        public Widget GetWidget(IInventory inventory, ComponentRifling component) => new RiflingWidget(inventory, component);
        public override DeviceBehavior[] GetBehaviors(Project project) => [new RiflingDeviceBehavior(project)];

        public ElectricElement CreateElectricElement(SubsystemElectricity subsystemElectricity, int value, int x, int y, int z) => new CrafterPopResultsElectricElement(subsystemElectricity, new Point3(x, y, z), GetDirection(value));

        public ElectricConnectorType? GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z) => ElectricConnectorType.Input;

        public int GetConnectionMask(int value) => int.MaxValue;
    }
}